Skip to content

M28, first part: read Commonage's own export - #72

Merged
SebHenn merged 7 commits into
mainfrom
m28-staging-fix
Nov 22, 2026
Merged

SebHenn merged 7 commits into
mainfrom
m28-staging-fix

Conversation

@SebHenn

@SebHenn SebHenn commented Nov 22, 2026

Copy link
Copy Markdown
Owner

What

An admin-only page (/Admin/ImportArchive) that reads Commonage's own export (versions 4 to 8), with a dry run first and nothing changed until an admin confirms. Plan: docs/plan-m28-toward-1-0.md.

  • Every item arrives as a draft; nothing writes Published. mediaLevel and publicFrom are kept.
  • Insert only. Duplicates are skipped (collection + NFC title + date text, and file sha256).
  • Contributor details and consent text are never read. Items whose source did not allow sharing, and rejected or withdrawn items, are skipped and listed.
  • Files go through MediaUploadService; the ZIP is size-, count-, depth- and path-limited, checksums verified.
  • Failing safely: stops after 5 repeated disk/database failures, stops between items on shutdown, per-item audit line for missing photos, orphan originals removed (only when no row exists).
  • Also fixes ImportStaging.DeleteOld so a folder that cannot be removed no longer breaks cleanup; staged files are owner-only on Linux.

Checks

Release build clean; 571 passed / 6 skipped / 0 failed; browser tests 210/210; gitleaks clean; three privacy reviews, no leak.

Not tested here

Owner-only file modes on Linux (CI first run), real phones, screen readers. A final-summary audit write can still fail if the database is down at the end of a run (low impact).

🤖 Generated with Claude Code

SebHenn and others added 7 commits November 19, 2026 19:54
…aks the import page

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Seb H. <[email protected]>
…s only)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Seb H. <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Seb H. <[email protected]>
- An item whose contribution does not say yes (no key, null) is left out, like a no.
- A file that cannot be stored costs only that file: counted, no error text shown; the PhotosAdded
  line is written in a finally; the run no longer takes the request's token.
- Cap on files in all of archive.json, and on recorded dry-run lines (the rest is counted and shown).
- The staged ZIP and its folder are owner-only where the system has such modes.
- Path regex ends with \z; "at most N characters" through T.Plural; handbooks and security.md updated.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Seb H. <[email protected]>
Stop a run after 5 failures in a row or when the app shuts down, and say how many items were not tried. Delete the stored original when its save fails and the .uploading file when a copy fails. Store alt text, caption and rotation in the photo's one save. Write the summary and photo lines in finally paths, log swallowed file errors by type, catch only store failures per file, and release the lock and remove staging when a run ends unexpectedly.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Seb H. <[email protected]>
…hen no row exists

A save that throws may still have committed (a dropped connection), so the
original is removed only when a fresh look finds no row; the entry is detached.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Seb H. <[email protected]>
@SebHenn
SebHenn merged commit 74413de into main Nov 22, 2026
12 checks passed
@SebHenn
SebHenn deleted the m28-staging-fix branch November 22, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant